﻿HmJS.$Import('ui.calendar.DatePicker');
//HmJS.$Import('core.domready');

HmJS.register('demo.module.ui.calendar.datepicker.pickerdate', function ($ns) {
	var that = {};

	that.todo = function () {

		var Picker = $ns.ui.Picker;

		myPicker = new Picker.Date($$('a.open, input'), {
			toggle: $$('.toggle'),
			positionOffset: { x: -10, y: 20 }
		});

		$('open').addEvent('click', function (e) {
			e.stop();
			myPicker.open();
		});
		$('close').addEvent('click', function (e) {
			e.stop();
			myPicker.close();
		});
		$('toggle').addEvent('click', function (e) {
			e.stop();
			myPicker.toggle();
		});

	};

	return that;
});
